<template>
  <div>
    <el-menu :default-active="active" class="el-menu-demo" mode="horizontal" @select="(key)=>menuActive=key">
      <el-menu-item index="1">项目明细</el-menu-item>
      <el-menu-item index="2">任务</el-menu-item>
      <el-menu-item index="3">人员管理</el-menu-item>
      <el-menu-item index="4">公告管理</el-menu-item>
<!--      <el-menu-item index="5">任务类型管理</el-menu-item>-->
    </el-menu>
    <div v-if="project">
      <overview v-if="menuActive==='1'" :project="project" :projectId="projectId"></overview>
      <task-list v-if="menuActive==='2'" :project="project" :projectId="projectId"></task-list>
      <member-list v-if="menuActive==='3'" :project="project" :projectId="projectId"></member-list>
      <notification-list :project-id="projectId" :project="project" v-if="menuActive==='4'"></notification-list>
    </div>
  </div>
</template>

<script>
import Overview from "@/views/project/init/overview/index.vue";
import TaskList from "@/views/project/init/taskList/index.vue";
import MemberList from "@/views/project/init/memberList/index.vue";
import NotificationList from "@/views/project/init/notificationList/index.vue";
import {getProject} from "@/api/project/project";

export default {
  name: "Init",

  components: {NotificationList, MemberList, TaskList, Overview},
  data() {
    return {
      active: '1',
      menuActive: '1',
      project: null,
    }
  },
  props: {
    projectId: {}
  },
  created() {
    this.active=this.$route.query.active||'1'
    console.log(this.$route.query);
    console.log(this.projectId)
    getProject(this.projectId).then(res => {
      this.project = res.data;
    })
  },
  methods: {}
}
</script>

<style scoped lang="scss">

</style>
